import { http } from "@/utils/http";

export type Result = any;

/** 预留发送短信验证码 */
export const sendSms = (data?: object) => {
  return http.request<Result>("post", "/api/shot/public/common/sms", { data });
};
/** 获取设备列表 */
export const getDeviceList = (data?: object) => {
  return http.request<Result>("post", "/central/control/device/page", { data });
};
/** 设备删除 */
export const deviceDelete = (params?: object) => {
  return http.request<Result>("get", "/central/control/device/delete", {
    params
  });
};
/** 设备编辑 */
export const deviceSave = (data?: object) => {
  return http.request<Result>("post", "/central/control/device/update", {
    data
  });
};
/** 设备批量排序 */
export const deviceSort = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/manage/device/batch/weight",
    {
      data
    }
  );
};
/** 游戏下拉列表 */
export const getGameList = (params?: object) => {
  return http.request<Result>("get", "/central/control/game/list", { params });
};

/** 获取任务列表 */
export const getTaskList = (data?: object) => {
  return http.request<Result>("post", "/central/control/task/page", { data });
};
/** 获取任务列表总数 */
export const getTaskCount = (data?: object) => {
  return http.request<Result>("post", "/central/control/manage/task/count", {
    data
  });
};
/** 任务详情 */
export const getTaskInfo = (params?: object) => {
  return http.request<Result>("get", "/central/control/task/info", { params });
};
/** 任务日志节点记录 */
export const getTaskLogInfo = (params?: object) => {
  return http.request<Result>("get", "/central/control/manage/task/record", {
    params
  });
};
/** 任务完成信息 */
export const getTaskCompleteInfo = (params?: object) => {
  return http.request<Result>(
    "get",
    "/central/control/manage/task/complete/info",
    {
      params
    }
  );
};
/**
 * 任务截图图片
 */
export const getTaskShotInfo = (params?: object) => {
  return http.request<Result>(
    "get",
    "/central/control/manage/task/shot/images",
    {
      params
    }
  );
};
/** 开始任务 */
export const taskStart = (data?: any) => {
  return http.request<Result>(
    "post",
    "/central/control/start",
    { data },
    {
      headers: {
        channelId: data.channelId
      }
    }
  );
};
/** 获取认证二维码 */
export const getQrCode = (data?: object) => {
  return http.request<Result>("post", "/central/control/get/qr/code", { data });
};
/** 轮询获取认证二维码认证结果 */
export const getQrCodeResult = (data?: object) => {
  return http.request<Result>("post", "/central/control/get/code/result", {
    data
  });
};
/** 后台提交验证码 */
export const submitSmsCode = (data?: object) => {
  return http.request<Result>("post", "/central/control/submit/sms/code", {
    data
  });
};
/** 游戏下拉列表 */
export const selectGames = (params?: object) => {
  return http.request<Result>("get", "/central/control/game/game/list", {
    params
  });
};
/** 截图任务 */
export const shotTaskList = (data?: object) => {
  return http.request<Result>("post", "/central/control/merchant/task/query", {
    data
  });
};
export const shotTaskDetail = (params?: object) => {
  return http.request<Result>("get", "/central/control/merchant/task/detail", {
    params
  });
};
/** 号商游戏下拉列表 */
export const selectMerchantGames = (params?: object) => {
  return http.request<Result>(
    "get",
    "/central/control/merchant/game/game/list",
    {
      params
    }
  );
};
/** 号商截图游戏列表 */
export const selectShotGames = (params?: object) => {
  return http.request<Result>("get", "/central/control/merchant/games", {
    params
  });
};
/** 号商截图账号 */
export const merchantUserList = (data?: object) => {
  return http.request<Result>("post", "/central/control/merchant/user/query", {
    data
  });
};
export const merchantUserSave = (data?: object) => {
  return http.request<Result>("post", "/central/control/merchant/user/save", {
    data
  });
};
/** 号商验签管理 */
export const merchantSignList = (data?: object) => {
  return http.request<Result>("post", "/central/control/merchant/sign/page", {
    data
  });
};
export const merchantSignSelect = (params?: object) => {
  return http.request<Result>("get", "/central/control/merchant/sign/select", {
    params
  });
};
export const merchantSignSave = (data?: object) => {
  return http.request<Result>("post", "/central/control/merchant/sign/save", {
    data
  });
};
export const merchantSignDel = (params?: object) => {
  return http.request<Result>("get", "/central/control/merchant/sign/delete", {
    params
  });
};
/** 任务游戏属性 */
export const gameParams = (params?: object) => {
  return http.request<Result>("get", "/central/control/game/params", {
    params
  });
};
/** 游戏管理 */
export const gameListPage = (data?: object) => {
  return http.request<Result>("post", "/central/control/game/game/page", {
    data
  });
};
export const gameListSave = (data?: object) => {
  return http.request<Result>("post", "/central/control/game/game/save", {
    data
  });
};
export const gameListDel = (data?: object) => {
  return http.request<Result>("post", "/central/control/game/game/delete", {
    data
  });
};
/** 号商游戏管理 */
export const merchantGameListPage = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/merchant/game/game/page",
    {
      data
    }
  );
};
export const merchantGameListSave = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/merchant/game/game/save",
    {
      data
    }
  );
};
export const merchantGameListDel = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/merchant/game/game/delete",
    {
      data
    }
  );
};
/** 游戏参数管理 */
export const gameParamList = (data?: object) => {
  return http.request<Result>("post", "/central/control/game/game/param/page", {
    data
  });
};
export const gameParamDetail = (data?: object) => {
  return http.request<Result>("post", "/central/control/game/game/param/info", {
    data
  });
};
export const gameParamSave = (data?: object) => {
  return http.request<Result>("post", "/central/control/game/game/param/save", {
    data
  });
};
export const gameParamDel = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/game/game/param/delete",
    {
      data
    }
  );
};
/** 号商游戏参数管理 */
export const merchantGameParamList = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/merchant/game/game/param/page",
    {
      data
    }
  );
};
export const merchantGameParamDetail = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/merchant/game/game/param/info",
    {
      data
    }
  );
};
export const merchantGameParamSave = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/merchant/game/game/param/save",
    {
      data
    }
  );
};
export const merchantGameParamDel = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/merchant/game/game/param/delete",
    {
      data
    }
  );
};
/** 根据用户获取权限游戏 */
export const permissionGame = (params?: object) => {
  return http.request<Result>(
    "get",
    "/central/control/game/permission/by/user",
    {
      params
    }
  );
};
/** 根据id获取号商截图账号详情 */
export const merchantUserInfo = (params?: object) => {
  return http.request<Result>("get", "/central/control/merchant/user/info", {
    params
  });
};
/** 驳回 */
export const rejectTask = (data?: object) => {
  return http.request<Result>("post", "/central/control/fail", {
    data
  });
};
/** 号商签名信息 */
export const merchantSignInfo = (params?: object) => {
  return http.request<Result>("get", "/central/control/merchant/sign/info", {
    params
  });
};
/** 任务数据概览 */
export const taskOverview = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/dashboard/task/overview",
    {
      data
    }
  );
};
/** 任务数据趋势 */
export const taskTrend = (data?: object) => {
  return http.request<Result>("post", "/central/control/dashboard/task/trend", {
    data
  });
};
/** 任务数据列表 */
export const taskDataList = (data?: object) => {
  return http.request<Result>("post", "/central/control/dashboard/task/list", {
    data
  });
};
/** 任务数据列表-导出 */
export const taskExportExcel = (data?: object) => {
  return http.request<Result>(
    "post",
    "/central/control/dashboard/task/export/excel",
    { data, responseType: "blob" }
  );
};
